package com.example.foobar.controller;

import com.example.config.QinNiuParam;
import com.example.foobar.business.service.DyService;
import com.example.foobar.entity.FooBar;
import com.example.foobar.vo.DyInfoVO;
import com.qiniu.storage.DownloadUrl;
import com.qiniu.util.Auth;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController;
import io.geekidea.springbootplus.framework.log.annotation.Module;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.websocket.server.PathParam;

/**
 * FooBar 控制器
 *
 * @author geekidea
 * @since 2021-05-31
 */
@Slf4j
@RestController
@RequestMapping("/dy")
@Module("qiniu")
@Api(value = "QiNiu", tags = {"抖音评论内容"})
public class DyController extends BaseController {


    @Autowired
    DyService dyService;

    @GetMapping("/getDyInfo/{uniacid}")
    @OperationLog(name = "获取抖音推广内容信息", type = OperationLogType.PAGE)
    @ApiOperation(value = "获取抖音推广内容信息", response = FooBar.class)
    public ApiResult<DyInfoVO> getDyInfo(@PathVariable("uniacid") String uniacid) throws Exception {
        DyInfoVO dyInfoVO =  dyService.getDyInfo(uniacid);
        return ApiResult.ok(dyInfoVO);
    }

}

